package com.igeek.boot_4_druid.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @Author: zhiyu
 * @Date:14:24
 * @DESC:
 */
@RestController
@Slf4j
public class MyController {
    @Resource
    private JdbcTemplate jdbcTemplate;
    @GetMapping("/count")
    public String selectCount(){
        Integer count = jdbcTemplate.queryForObject("select count(*) from user", Integer.class);
        System.out.println("count = " + count);
        return count+"";
    }
}
